# 剩余密码次数
# cout=0
# while cout<3:
#     cout+=1
#     user=input("输入用户名：")
#     password=input("输入密码：")
#     if user=="root"and password=="123":
#         print("成功")
#     else:
#         message=f"用户密码错误，剩余错误机会还有{3-cout}次"
#         print(message)
#
# 计算机猜数字6,7,8
count = 0
list_number = ['6', '7', '8']
while count < 3:
    count += 1
    number = input("请输入数字（1-10）：\n")
    if number.isdecimal():
        if int(number) > 10 or int(number) < 0:
            continue
        # list_number={'6','7','8'}
        if number in list_number:
            # if number=="8"or number=="6"or number=="7":
            print("猜对了")
        else:
            print("猜错了")
    if count == 3:
        chioce = input("是否还想继续猜：（Y/N）")
        if chioce == "Y":
            count = 0
            continue
        elif chioce == "N":
            print("结束")
            break
        else:
            print("游戏结束")
            break
